package com.ocom.common.enums;

public enum ConsStateEnum {

    /**
     * 消费状态，1：消费；2：退款；3：点餐；4.取餐；5.订餐；6：退订；10：充值；11：提现；12：补贴；13：清卡；21：销户
     */
    PAY(1,"消费"),
    REFUND(2,"退款"),
    MEAL(3,"点餐"),
    GETMEAL(4,"取餐"),
    ORDER(5,"订餐"),
    REORDER(6,"退订"),
    CART(7,"购物车"),
    RECHARGE(10,"充值"),
    TIXIAN(11,"提现"),
    BUTIE(12,"补贴"),
    CLEANCARD(13,"清卡"),
    JIAOFEI(111,"缴费"),

    DESTORY(21,"销户"),
    DELAYPAY(205,"延迟代扣");
    // 成员变量

    private final Integer key;
    private final String msg;

    ConsStateEnum(Integer key, String msg) {
        this.key = key;
        this.msg = msg;
    }

    /**
     * 根据key获取value
     *
     * @param key : 键值key
     * @return String
     */
    public static String getValueByKey(Integer key) {
        ConsStateEnum[] enums = ConsStateEnum.values();
        for (int i = 0; i < enums.length; i++) {
            if (enums[i].getKey().equals(key)) {
                return enums[i].getMsg();
            }
        }
        return "";
    }

    public Integer getKey() {
        return key;
    }

    public String getMsg() {
        return msg;
    }
}
